package com.example.a33mvvm.home;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.example.base_mvvm.base.BaseViewModel;
import com.example.base_mvvm.entity.BannerEntity;
import com.example.base_mvvm.entity.HomeVideoEntity;
import com.example.base_mvvm.entity.LikeEntity;

public class BannerViewModel extends BaseViewModel<BannerRepo> {
    public MutableLiveData<BannerEntity> banner_success = new MutableLiveData<>();
    public MutableLiveData<String> banner_failure = new MutableLiveData<>();
    public MutableLiveData<HomeVideoEntity> homeVideo_success = new MutableLiveData<>();
    public MutableLiveData<String> homeVideo_failure = new MutableLiveData<>();
    public MutableLiveData<LikeEntity> like_success = new MutableLiveData<>();
    public MutableLiveData<String> like_failure = new MutableLiveData<>();
    public MutableLiveData<LikeEntity> disLike_success = new MutableLiveData<>();
    public MutableLiveData<String> disLike_failure = new MutableLiveData<>();

    public BannerViewModel(@NonNull Application application) {
        super(application);
    }
    public void homeVideo(int page,int size){
        repo.video(page,size,homeVideo_success,homeVideo_failure);
    }
    public void like(int id){
        repo.like(id,like_success,like_failure);
    }
    public void disLike(int id){
        repo.disLike(id,disLike_success,disLike_failure);
    }
    public void banner(){
        repo.banner(banner_success,banner_failure);
    }
    @Override
    protected BannerRepo createRepo() {
        return new BannerRepo();
    }
}
